.sensor-card {
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    text-align: center;
    height: 500px; /* 统一卡片高度 */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* 温度计样式 */
.thermometer {
    width: 100px;
    height: 300px;
    margin: 0 auto 20px;
    position: relative;
}

.thermometer-body {
    width: 30px;
    height: 100%;
    background: #f0f0f0;
    border-radius: 15px;
    position: relative;
    margin: 0 auto;
}

.thermometer-scale {
    position: absolute;
    right: -40px;
    top: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 14px;
    color: #666;
}

.thermometer-scale span {
    display: block;
    margin: 5px 0;
}

.thermometer-mercury {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 25%;
    background: linear-gradient(to top, #ff4444, #ff0000);
    border-radius: 15px;
    transition: height 0.3s ease;
}

/* 湿度计样式 */
.humidity-meter {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    position: relative;
}

.humidity-circle {
    width: 100%;
    height: 100%;
    border: 10px solid #f0f0f0;
    border-radius: 50%;
    position: relative;
}

.humidity-indicator {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(#4CAF50 0%, #4CAF50 50%, #f0f0f0 50%, #f0f0f0 100%);
    clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%, 50% 100%);
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

/* 水位计样式 */
.water-level-container {
    width: 100px;
    height: 300px;
    margin: 0 auto 20px;
    position: relative;
}

.water-level-tank {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.water-level {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(to top, #2196F3, #64B5F6);
    transition: height 0.3s ease;
}

.sensor-value {
    font-size: 24px;
    font-weight: bold;
    margin-top: 10px;
}

.form-range {
    width: 100%;
    margin: 20px 0;
}

h3 {
    color: #333;
    margin-bottom: 20px;
}

/* 图表容器样式 */
.chart-container {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chart-title {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.chart-wrapper {
    height: 300px;
    margin-bottom: 30px;
} 

/* 设备状态卡片样式 */
.device-status-container {
    margin-bottom: 2rem;
}

.device-title {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

.device-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    transition: transform 0.2s;
}

.device-card:hover {
    transform: translateY(-5px);
}

.device-card h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.device-card h3 i {
    font-size: 1.2em;
    color: #3498db;
}

.device-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.status-indicator {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.status-indicator.on {
    background-color: #2ecc71;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

/* 聊天对话框样式 */
.chat-container {
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chat-title {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.chat-box {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
}

.message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 14px;
}

.user-message {
    background: #e3f2fd;
    color: #1976d2;
    margin-left: auto;
    border: 1px solid #bbdefb;
}

.assistant-message {
    background: #f5f5f5;
    color: #333;
    margin-right: auto;
    border: 1px solid #e0e0e0;
}

/* Markdown 样式 */
.assistant-message h1,
.assistant-message h2,
.assistant-message h3,
.assistant-message h4,
.assistant-message h5,
.assistant-message h6 {
    margin-top: 0.8em;
    margin-bottom: 0.4em;
    font-weight: 600;
    color: #2c3e50;
}

.assistant-message h1 { font-size: 1.4em; }
.assistant-message h2 { font-size: 1.3em; }
.assistant-message h3 { font-size: 1.2em; }
.assistant-message h4 { font-size: 1.1em; }
.assistant-message h5 { font-size: 1em; }
.assistant-message h6 { font-size: 0.9em; }

.assistant-message p {
    margin-bottom: 0.8em;
    line-height: 1.6;
}

.assistant-message ul,
.assistant-message ol {
    margin-bottom: 0.8em;
    padding-left: 1.5em;
}

.assistant-message li {
    margin-bottom: 0.4em;
}

.assistant-message code {
    background: #f1f1f1;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
    color: #e74c3c;
}

.assistant-message pre {
    background: #f8f9fa;
    padding: 0.8em;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 0.8em;
    border: 1px solid #e0e0e0;
}

.assistant-message pre code {
    background: none;
    padding: 0;
    color: #333;
}

.assistant-message table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 0.8em;
    font-size: 0.9em;
}

.assistant-message th,
.assistant-message td {
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    text-align: left;
}

.assistant-message th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.assistant-message blockquote {
    border-left: 4px solid #e0e0e0;
    padding-left: 1em;
    margin-left: 0;
    color: #666;
    font-style: italic;
}

/* 加载指示器样式 */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.loading-text {
    color: #666;
    font-size: 0.9em;
}

/* 聊天输入容器样式 */
.chat-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input-container input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.chat-input-container button {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
}

.chat-input-container button.sending {
    opacity: 0.7;
    cursor: not-allowed;
}

.status-indicator.off {
    background-color: #e74c3c;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.status-text {
    font-weight: 500;
    color: #7f8c8d;
}

.device-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
}

.device-info p {
    margin: 0.5rem 0;
    color: #34495e;
}

.device-info span {
    font-weight: 500;
    color: #2980b9;
}